package com.simple.gateway.core.executor.result;

/**
 * 项目: simple-gateway
 * <p>
 * 功能描述: 执行结果
 *
 * @author: WuChengXing
 * @create: 2023-08-05 16:09
 **/
public class SessionResult {

    private final String code;
    private final String info;
    private final Object data;

    protected SessionResult(String code, String info, Object data) {
        this.code = code;
        this.info = info;
        this.data = data;
    }

    public static SessionResult buildSuccess(Object data){
        return new SessionResult("0000","调用成功", data);
    }

    public static SessionResult buildError(Object data){
        return new SessionResult("0001","调用失败", data);
    }

    public String getCode() {
        return code;
    }

    public String getInfo() {
        return info;
    }

    public Object getData() {
        return data;
    }
}
